{% extends "base.html"%}
{% block content%}
	 <td></td>
	  <td colspan="5">
	    <table border="1" cellspaceing="0" cellpadding="0">
	      <tr >
	        <td colspan="2" id="1" >
		<script>
		window.onload = function () {
	        var map = new YMaps.Map(document.getElementById("YMapsID"));
	        map.setCenter(new YMaps.GeoPoint(135.11793, 48.47854), 12);
	        var zoom = new YMaps.Zoom({customTips: [{ index: 6, value: "Весь край" },{ index: 12, value: "Город" },{ index: 16, value: "Близко" }]});
	        map.addControl(zoom);
        	var search = new YMaps.SearchControl({ width:15 });
	        map.addControl(search);
		var gCollection = new YMaps.GeoObjectCollection();
                {% for cafe in cafes %}
                var placemark = new YMaps.Placemark(new YMaps.GeoPoint({{cafe.cafe_geo}}), {style: "default#cafeIcon"});
		placemark.setBalloonContent("<b><a href='/food/shcafe/{{cafe.id}}' class='cname'>{{cafe.cafe_name}}</a></b><table width=100%> \
		<tr valign='top'><td><br><span class='st_pr'>ул.{{cafe.cafe_stret}} д.{{cafe.cafe_house}}\
		<br>Чек:{{cafe.cafe_price}}</span></div></td>\
        <td><div><img src='/files/{{cafe.cafe_logo}}' border=0 align='right'></td>\
        </tr></table>");

		gCollection.add(placemark);
		{% endfor %}		
		map.addOverlay(gCollection);
		}
		</script>		
		<div id="YMapsID" style="width:750px;height:400px"></div>
		</td>
	      </tr>
	    </table>
	  </td>
	<td valign="top">
	{% include "tags.html" %}
	</td>
	<td></td>
      </tr>
      <tr>
	  <td height=13px colspan="8"></td>
      </tr>
      <tr>
      <td></td>
        <td colspan="5">
          <table bgcolor="#d8d8d8" width="750px" cellspaceing="0" cellpadding="0" border="0px" >
          <tr class="tabletop">
	     <td width = "150px">Фото</td>
	     <td width = "50px">Рейтинг <br><a href="/food/sort/0/0/" class="strelki">↑</a>&nbsp;&nbsp;<a href="/food/sort/0/1/" class="strelki">↓</a> </td>
	     <td width = "200">Название</td>
	     <td width = "100">Средний чек<br> <a href="/food/sort/1/0/" class="strelki">↑</a>&nbsp;&nbsp;<a href="/food/sort/1/1/" class="strelki">↓</a></td>
	     <td width = "250">Адрес</td>
          </tr>
          </table>
	 {% for cafe in cafes %}
	   {% if forloop.counter|divisibleby:"2" %}
          <table bgcolor="#ffffff" width="750px" cellspaceing='0px' cellpadding='0px'  border='0px' >
          <tr >
             <td width = "150px"><img src="/files/{{cafe.cafe_logo}}" border="0"></td>
            {% if cafe.cafe_reiting > "0" %}
             <td width = "100px"><span class="gren">{{cafe.cafe_reiting}}</span>&nbsp;&nbsp;<a href="/food/plusr/{{cafe.id}}/" class="gren">+</a>&nbsp;&nbsp;<a href="/food/minusr/{{cafe.id}}/" class="red">-</a></td>
            {% else %}
             <td width = "100px"><span class="red">{{cafe.cafe_reiting}}</span>&nbsp;&nbsp;<a href="/food/plusr/{{cafe.id}}/" class="gren">+</a>&nbsp;&nbsp;<a href="/food/minusr/{{cafe.id}}/" class="red">-</a></td>
            {% endif %}
             <td width = "200px"><a href="/food/shcafe/{{cafe.id}}" class="cname">{{cafe.cafe_name}}</a></td>
             <td width = "100px" class="st_pr">{{cafe.cafe_price}}</td>
             <td width = "200px" class="st_pr">ул. {{cafe.cafe_stret}}, д.{{cafe.cafe_house}}</td>
          </tr>
          </table>
	   {% else %}
          <table bgcolor="#ffddff" width="750px" cellspaceing='0px' cellpadding='0px'  border='0px' >
          <tr>
             <td width = "150px"><img src="/files/{{cafe.cafe_logo}}" border="0"></td>
            {% if cafe.cafe_reiting > "0" %}
             <td width = "100px"><span class="gren">{{cafe.cafe_reiting}}</span>&nbsp;&nbsp;<a href="/food/plusr/{{cafe.id}}/" class="gren">+</a>&nbsp;&nbsp;<a href="/food/minusr/{{cafe.id}}/" class="red">-</a></td>
            {% else %}
             <td width = "100px"><span class="red">{{cafe.cafe_reiting}}</span>&nbsp;&nbsp;<a href="/food/plusr/{{cafe.id}}/" class="gren">+</a>&nbsp;&nbsp;<a href="/food/minusr/{{cafe.id}}/" class="red">-</a></td>
            {% endif %}
             <td width = "200px"><a href="/food/shcafe/{{cafe.id}}" class="cname">{{cafe.cafe_name}}</a></td>
             <td width = "100px" class="st_pr">{{cafe.cafe_price}}</td>
             <td width = "200px" class="st_pr">ул. {{cafe.cafe_stret}}, д.{{cafe.cafe_house}}</td>
          </tr>
          </table>
	   {% endif %}
	{% endfor %}
	<br><br>
	</td>

	<td>&nbsp;</td>
	<td ></td>

{% endblock %}

